package com.loong.user.controller.backend;

import com.loong.common.mvc.BaseBackendController;
import com.loong.common.rest.Result;
import com.loong.common.validator.group.CommonInsert;
import com.loong.common.validator.group.CommonValidate;
import com.loong.user.common.backend.param.ManageUserRoleAuthParam;
import com.loong.user.handler.ManageUserRoleAuthHandler;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description: 角色分配资源控制器
 * @Author: hzp
 * @Date: 2020-10-19 9:36
 */
@RestController
@RequestMapping("manage/user/systemRoleAuth")
public class ManageUserRoleAuthController extends BaseBackendController {
    @Resource
    private ManageUserRoleAuthHandler manageUserRoleAuthHandler;

    /***
     * 保存 角色分配资源
     * @param param
     * @return
     */
    @PostMapping("save")
    public Result save(@Validated(value = {CommonInsert.class, CommonValidate.class}) ManageUserRoleAuthParam param){
        return   handlerExecutor.execute(()->manageUserRoleAuthHandler.save(param));
    }
}
